package me.zk.practice1.s;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author zhangkai
 * @date 2023/7/6 11:22
 */
public class LS448 {
    public static List<Integer> findDisappearedNumbers(int[] nums) {
        int n = nums.length;

        for(int num : nums) {
            int x = (num-1)%n;
            nums[x] +=n;
        }
       System.out.println( Arrays.toString(nums));

        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (nums[i]<=n) {
                list.add(i+1);
            }
        }
        return list;

    }

    public static void main(String[] args) {
        findDisappearedNumbers(new int[]{4,3,2,7,8,2,3,1});
    }
}
